<admintpl file="header"/>
<head/>
<body>
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
      <foreach name="cate" item="vo">
          <li <eq name="cate_id" value="$vo['id']">class="active"</eq> ><a href="{:U('admin/param/index',array('cate_id'=>$vo['id']))}">{$vo.name}</a></li>
      </foreach>

      <if condition="APP_DEBUG">
          <li ><a href="{:U('admin/Param/add')}">添加参数</a></li>
      </if>

  </ul>
  <div class="table_list">
   <form class="form-horizontal J_ajaxForm" method="post" action="{:U('admin/param/updata')}">
    <table width="100%" cellspacing="0" class="table table-hover">
      <thead>
        <tr>
          <th width="30">ID</th>
          <th align="left" >参数说明</th>
          <th >参数值</th>
          <th >变量名称</th>
            <if condition="APP_DEBUG">
          <th >管理操作</th>
                </if>
        </tr>
      </thead>
      <tbody>

        <foreach name="list" item="vo">
        <tr>
          <td>{$vo.id}</td>
          <td>{$vo.remark}</td>
            <if condition="($vo['type'] eq 1)">
                <td><input type="text" name="value[{$vo.id}]" value="{$vo.value}" style="margin: 0;padding: 0;"></input></td>
                <else/>
                <td>
   
                    
                    <select name="value[{$vo.id}]" class="normal_select" >
						<option value="1"  <eq name="vo.value" value="1">selected</eq> >是</option>
               			<option value="0" <eq name="vo.value" value="0">selected</eq> >否</option>
                	</select>
                    
                    
                    
                </td>
            </if>

          <td>{$vo.var_name}</td>
            <input type="hidden" name="id[{$vo.id}]" value="{$vo.id}"/>
        <if condition="APP_DEBUG">

          <td  class="text-c">
              <a href="{:U('admin/param/edit',array('id'=>$vo['id']))}"   >编辑</a>
          </td>
        </if>
        </tr>
        </foreach>



      </tbody>
    </table>
      <div class="form-actions">
          <button type="submit" class="btn btn-primary btn_submit  J_ajax_submit_btn">更新</button>
      </div>
      </form>
  </div>
</div>
<script>
    if ($('a.J_ajax_del').length) {
        Wind.use('artDialog', function () {
            $('.J_ajax_del').on('click', function (e) {
                e.preventDefault();
                var $_this = this,
                        $this = $($_this),
                        href = $this.prop('href'),
                        msg = $this.data('msg');
                art.dialog({
                    title: false,
                    icon: 'question',
                    content: '您确定要改变支付方式状态吗？',
                    follow: $_this,
                    close: function () {
                        $_this.focus();; //关闭时让触发弹窗的元素获取焦点
                        return true;
                    },
                    ok: function () {

                        $.getJSON(href).done(function (data) {
                            if (data.state === 'success') {
                                if (data.referer) {
                                    location.href = data.referer;
                                } else {
                                    reloadPage(window);
                                }
                            } else if (data.state === 'fail') {
                                //art.dialog.alert(data.info);
                                alert(data.info);//暂时处理方案
                            }
                        });
                    },
                    cancelVal: '关闭',
                    cancel: true
                });
            });

        });
    }

</script>
<script src="__ROOT__/statics/js/common.js"></script>

</body>
</html>